//模块接口
import request from '@/utils/request'

const api = {
  // getTree:'/cms/sysModule/queryTreeList',
  getTree:'/cms/sysModule//queryPageList',
  deletemodule:'/cms/sysModule/delete',
  sava:'/cms/sysModule/save',
  get:'/cms/sysModule/get',
  fenpeicaidan:'/cms/sysModule/saveMenu',
  fenpeijuese:'/cms/sysModule/saveRole',
  caidanTree:'/cms/sysMenu/queryTreeList',
  jueseTree:'/cms/sysRole/queryAllList',
  mokuaijuese:'/cms/sysModule/queryRoleListByModuleId',

  queryList:'/cms/sysMenu/queryList' ,//userID source  查询个人菜单列表


}
  //列表
  export function getTree (parameter) {
    return request({
      url: api.getTree,
      method: 'post',
      data: parameter
    })
  }
  //删除模块
  export function deletemodule (parameter) {
    return request({
      url: api.deletemodule,
      method: 'post',
      data: parameter
    })
  }
    //保存模块
    export function sava (parameter) {
      return request({
        url: api.sava,
        method: 'post',
        data: parameter
      })
    }
    //根据ID查询模块
    export function get (parameter) {
      return request({
        url: api.get,
        method: 'post',
        data: parameter
      })
    }
    //获取菜单列表
    export function caidanTree (parameter) {
      return request({
        url: api.caidanTree,
        method: 'post',
        data: parameter
      })
    }
    //分配菜单
    export function fenpeicaidan (parameter) {
      return request({
        url: api.fenpeicaidan,
        method: 'post',
        data: parameter
      })
    }
    //分配角色 
    export function fenpeijuesea (parameter) {
      return request({
        url: api.fenpeijuese,
        method: 'post',
        data: parameter
      })
    }
    //获取角色列表  
    export function jueseTree (parameter) {
      return request({
        url: api.jueseTree,
        method: 'post',
        data: parameter
      })
    }
//根据ID查询模块下的角色
export function mokuaijuese (parameter) {
  return request({
    url: api.mokuaijuese,
    method: 'post',
    data: parameter
  })
}

//根据ID查询模块下的角色
export function queryList (parameter) {
  return request({
    url: api.queryList,
    method: 'post',
    data: parameter
  })
}

